﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom.Compiler;

namespace CodeScrapWindow
{
	/// <summary>
	/// An interface for classes that provide compiler functionality.
	/// </summary>
	internal interface ICompilerProvider
	{
		/// <summary>
		/// Gets the name of the compiler to show to the user.
		/// </summary>
		string Name
		{
			get;
		}

		/// <summary>
		/// Gets the language service GUID to use for syntax coloring.
		/// </summary>
		/// <value>The language service GUID.</value>
		string LanguageServiceGuid
		{
			get;
		}

		/// <summary>
		/// Builds the class code from the code entered by the user.
		/// </summary>
		/// <param name="imports">The namespaces to add as import/using statements.</param>
		/// <param name="code">The code entered by the user.</param>
		/// <returns>
		/// A complete, compilable class with the namespace, class name and method name coming from the <see cref="CodeScrapWindow.Constants"/> class.
		/// </returns>
		string BuildCode(IEnumerable<string> imports, string code);

		/// <summary>
		/// Gets the language-specific DOM provider to use for compiling code.
		/// </summary>
		/// <returns>The CodeDomProvider to use for compiling code.</returns>
		CodeDomProvider GetCompiler();
	}
}
